package information;

import java.util.Comparator;

/**
 * Comparator for comparing districts of two jobs.
 * Supports User story 7
 * @author Christian
 *
 */
public class JobDistrictComparator implements Comparator<Job>{
	//@requires the jobs, parks and districts not null and are properly populated
	//@ensures that one job is >, =, or < the other job based on districts
	public int compare(Job j1, Job j2) {
		String district1 = j1.getPark().getMyDistrict().toLowerCase();
		String district2 = j2.getPark().getMyDistrict().toLowerCase();
		return district1.compareTo(district2);
	}
}
